﻿using Application.AppService.Config;
using Application.AppService.IConfig;
using AutoMapper;
using Domain;
using Domain.Entity.Config;
using Microsoft.AspNetCore.Mvc;

namespace UI.Controllers.MoKuaiYi_第一个模块_.Interview_management_面试管理_
{
    public class EIController : Controller
    {
        private readonly IMapper mapper;
        private readonly IEngage_interviewAppService eIAppService;
        private readonly IEngage_resumeAppService eRAppService;

        public EIController(IMapper mapper, IEngage_interviewAppService eIAppService, IEngage_resumeAppService eRAppService)
        {
            this.mapper = mapper;
            this.eIAppService = eIAppService;
            this.eRAppService = eRAppService;
        }
        public IActionResult Index()
        {
            return View();
        }
        public IActionResult Index1()
        {
            return View();
        }
        [HttpPost("FYEI")]
        public IActionResult FYEI(int page,int pageSize)
        {
            EIFenYe fenYe=eIAppService.DateEIAsync(page, pageSize,1);
            return Json(fenYe);
        }
        [HttpPost("UpdateEI")]
        public async Task<IActionResult> UpdateEI(Engage_interview ei)
        {
            bool rs = await eIAppService.UpdateEIAsync(ei);
            return Json(rs);
        }
        [HttpPost("UpdateERSS")]
        public async Task<IActionResult> UpdateERSS(Engage_resume er)
        {
            bool rs = await eRAppService.UpdateERSAsync(er);
            return Json(rs);
        }

        [HttpPost("DeleteER")]
        public async Task<IActionResult> DeleteER(int id)
        {
            bool rs = await eRAppService.DeleteERAsync(id);
            return Json(rs);
        }

        [HttpPost("DeleteEI")]
        public async Task<IActionResult> DeleteEI(int id)
        {
            bool rs = await eIAppService.DeleteEIAsync(id);
            return Json(rs);
        }

        [HttpPost("UpdateEIS")]
        public async Task<IActionResult> UpdateEIS(Engage_interview ei)
        {
            bool rs = await eIAppService.UpdateEISAsync(ei);
            return Json(rs);
        }

    }
}
